<!DOCTYPE html>
<html>

<head>
    <title>游记列表</title>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="/js/bootstrap/css/bootstrap.min.css">
    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/bootstrap/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css">
    <link rel="stylesheet" href="/css/reset.css"/>
    <link rel="stylesheet" href="/css/travel.css"/>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css">
    <script src="/js/plugins/dialog2/dialog.min.js"></script>
    <script>
        $(function () {

            var keyword = sessionStorage.getItem("keyword");
            //搜索
            $.get("/travel", {keyword: keyword}, function (data) {
                console.log(data);
                $("#allTravels").renderValues({list:data.list},{
                    setHref:function (item, value) {
                        //重新设置href
                        $(item).attr("href",$(item).attr("href")+value);
                    }
                })
                //搜索框回显
                $(".searchBtn").val(keyword);

            })
        })

    </script>


</head>

<body>


<div class="search-head">
    <div class="row nav-search">
        <div class="col-2">
            <a href="index.html">
                <span><i class="fa fa-chevron-left fa-2x"></i></span>
            </a>
        </div>
        <div class="col-10">
            <div class="input-group-sm search">
                <input class="form-control searchBtn" placeholder="搜游记">
            </div>
        </div>
    </div>
</div>

<div class="container">
    <h6>搜索结果</h6>
    <div id="allTravels">
        <div render-loop="list">
            <div class="row detail">
                <div class="col">
                    <a href="/travelContent.html?id="  render-fun="setHref" render-key="list.id">
                        <h4 render-html="list.title"></h4>
                    </a>
                    <p>
                        <a href="/userProfiles.html?id=" render-fun="setHref" render-key="list.author.id">
                            <img class="rounded-circle head-img" render-src="list.author.headImgUrl">
                            <span render-html="list.author.nickName"></span></a> 在
                        <span class="addr" render-html="list.place.name"></span>

                    </p>
                    <p>
                        <i class="fa fa-eye fa-fw"></i>
                        <span>0</span>
                        <i class="fa fa-commenting fa-fw"></i>
                        <span>0</span>
                    </p>
                </div>
                <div class="col bigimg">
                    <a href="/travelContent.html?id=" render-fun="setHref" render-key="list.id">
                        <img render-src="list.coverUrl">
                    </a>
                </div>
            </div>
        </div>
    </div>
</div>


</body>

</html>